/* 组件样式文件 - 科技感暗黑主题 */

/* Toast 通知组件 */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.2);
  animation: slideInRight 0.3s ease-out;
  transition: all 0.3s ease;
  color: white;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(16, 185, 129, 0.3);
}

.toast.warning {
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(245, 158, 11, 0.3);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(239, 68, 68, 0.3);
}

.toast.info {
  border-color: rgba(6, 182, 212, 0.5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.3);
}

.toast-icon {
  margin-right: 0.75rem;
  font-size: 1.25rem;
  text-shadow: 0 0 10px currentColor;
}

.toast.success .toast-icon { color: #10B981; }
.toast.warning .toast-icon { color: #F59E0B; }
.toast.error .toast-icon { color: #EF4444; }
.toast.info .toast-icon { color: #06B6D4; }

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #E2E8F0;
}

.toast-message {
  font-size: 0.875rem;
  color: #CBD5E1;
}

.toast-close {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.2s;
}

.toast-close:hover {
  background-color: rgba(59, 130, 246, 0.2);
  color: #E2E8F0;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* 模态框组件 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 1rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(59, 130, 246, 0.2);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  color: white;
  display: flex;
  flex-direction: column;
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(59, 130, 246, 0.1);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #E2E8F0;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  font-size: 1.25rem;
}

.modal-close:hover {
  background-color: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(15, 23, 42, 0.5);
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* 按钮组件 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 0.5rem;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #3B82F6, #1E40AF);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1E40AF, #1E3A8A);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
}

.btn-secondary {
  background: linear-gradient(135deg, #6B7280, #4B5563);
  color: white;
  box-shadow: 0 4px 15px rgba(107, 114, 128, 0.4);
}

.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4B5563, #374151);
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.6);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6);
  transform: translateY(-2px);
}

.btn-warning {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.btn-warning:hover:not(:disabled) {
  background: linear-gradient(135deg, #D97706, #B45309);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, #DC2626, #B91C1C);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.6);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  border: 1px solid currentColor;
}

.btn-outline-primary {
  color: #3B82F6;
  border-color: #3B82F6;
}

.btn-outline-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #3B82F6, #1E40AF);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
}

/* 卡片组件 */
.card {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(59, 130, 246, 0.1);
  overflow: hidden;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.05);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #E2E8F0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-body {
  padding: 1.5rem;
  color: #CBD5E1;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(15, 23, 42, 0.5);
}

/* 表单组件 */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #E2E8F0;
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: #E2E8F0;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 0 15px rgba(59, 130, 246, 0.3);
  background: rgba(15, 23, 42, 0.9);
}

.form-control::placeholder {
  color: #64748B;
}

.form-control.error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.form-error {
  font-size: 0.75rem;
  color: #EF4444;
  margin-top: 0.25rem;
}

.form-help {
  font-size: 0.75rem;
  color: #94A3B8;
  margin-top: 0.25rem;
}

/* 表格组件 */
.table-container {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(10px);
}

.table {
  width: 100%;
  border-collapse: collapse;
  color: #E2E8F0;
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(59, 130, 246, 0.1);
}

.table th {
  background: rgba(59, 130, 246, 0.1);
  font-weight: 600;
  color: #E2E8F0;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table td {
  font-size: 0.875rem;
  color: #CBD5E1;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background: rgba(59, 130, 246, 0.05);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.1);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

/* 表格排序样式 */
.sortable {
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.sortable:hover {
  background-color: rgba(59, 130, 246, 0.15);
}

/* 徽章组件 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-primary {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(59, 130, 246, 0.3));
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.3));
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.3));
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.3));
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-secondary {
  background: linear-gradient(135deg, rgba(107, 114, 128, 0.2), rgba(107, 114, 128, 0.3));
  color: #9CA3AF;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

/* 加载状态 */
.loading {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid rgba(59, 130, 246, 0.2);
  border-top: 2px solid #3B82F6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.skeleton {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.8) 25%, rgba(59, 130, 246, 0.1) 50%, rgba(30, 41, 59, 0.8) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 下拉菜单 */
.dropdown-menu {
  position: absolute;
  background: rgba(30, 41, 59, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 0.75rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  min-width: 200px;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 0.75rem 1rem;
  color: #CBD5E1;
  text-decoration: none;
  transition: all 0.2s ease;
  border-radius: 0.5rem;
  margin: 0.25rem;
}

.dropdown-menu a:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #E2E8F0;
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
